<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Long objects</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_longs.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Long objects<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Long Objects encapsulate Oracle LONGs data types and were used to store large buffers in Oracle database.</p>
<p>They're still supported but are depreciated. Oracle now provides a newer and better way to deal with data that needs large storage : LOBs</p>
<p>OCILIB supports this data type because it was and still is widely used</p>
<p>OCILIB provides a set of API for manipulating LONGs that is really close to the one provided for LOBs.</p>
<p>OCILIB currently supports 3 types of Long Objects:</p>
<ul>
<li>OCI_BLONG : LONG RAW columns</li>
<li>OCI_CLONG : LONG columns</li>
</ul>
<p>OCI_Lob objects can be :</p>
<ul>
<li>Created as standalone instances</li>
<li>Used for in/out binding</li>
<li>Retrieved from select statement</li>
</ul>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define FILENAME &quot;data.lst&quot;</span></div>
<div class="line"><span class="preprocessor">#define SIZE_BUF 512</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *st;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gae0c7aa9c507975d21ca6c261081ba753">OCI_Resultset</a> *rs;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg;</div>
<div class="line">    FILE *f;</div>
<div class="line">    <span class="keywordtype">char</span> buffer[SIZE_BUF];</div>
<div class="line">    <span class="keywordtype">int</span> n;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(<span class="stringliteral">&quot;db&quot;</span>, <span class="stringliteral">&quot;usr&quot;</span>, <span class="stringliteral">&quot;pwd&quot;</span>, OCI_SESSION_DEFAULT);</div>
<div class="line">    st = <a class="code" href="group___ocilib_c_api_statements.html#ga335822f983af0fb5c529431f06a9a17b">OCI_StatementCreate</a>(cn);</div>
<div class="line"> </div>
<div class="line">     <span class="comment">/* open the data file */</span></div>
<div class="line"></div>
<div class="line">    f = fopen(FILENAME, <span class="stringliteral">&quot;rb&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (f)</div>
<div class="line">    {</div>
<div class="line">        fseek (f , 0 , SEEK_END); </div>
<div class="line">        n = ftell(f); </div>
<div class="line">        rewind (f);  </div>
<div class="line">  </div>
<div class="line">        printf(<span class="stringliteral">&quot;\n%d bytes to write\n&quot;</span>, n);</div>
<div class="line"></div>
<div class="line">        lg = <a class="code" href="group___ocilib_c_api_longs.html#ga040ec19ae09a29b34e0143e39ab30939">OCI_LongCreate</a>(st, OCI_BLONG);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st,  <span class="stringliteral">&quot;insert into test_long_raw(code, content) values (1, :data)&quot;</span>);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_binding.html#gab889e6aadf49c248713ada483bafccc0">OCI_BindLong</a>(st, <span class="stringliteral">&quot;:data&quot;</span>, lg, n);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* write data into table by chunks of SIZE_BUF bytes */</span>       </div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> ((n = fread(buffer, 1, <span class="keyword">sizeof</span>(buffer), f)))</div>
<div class="line">        {</div>
<div class="line">            <a class="code" href="group___ocilib_c_api_longs.html#ga1a76c2c5de1c81d38be17bf28524ce99">OCI_LongWrite</a>(lg, buffer, n);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        printf(<span class="stringliteral">&quot;\n%d bytes written\n&quot;</span>, <a class="code" href="group___ocilib_c_api_longs.html#gaf7ed15bc901e38b9bc3394f334bf8d4c">OCI_LongGetSize</a>(lg));</div>
<div class="line">        fclose(f);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_longs.html#gadc23551bd5aa7832cbaee4e32a2b283a">OCI_LongFree</a>(lg);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* FETCHING LONGS  -------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"> </div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, <span class="stringliteral">&quot;select content from test_long_raw where code = 1&quot;</span>);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statement_control.html#ga0aec6183761a7d90307ba785733888e0">OCI_SetLongMaxSize</a>(st, 10000);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* read data by chunks of 2048 bytes*/</span>       </div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        lg = <a class="code" href="group___ocilib_c_api_fetching.html#ga8c750dc1ea6d90c61cc2ebff5fb0c561">OCI_GetLong</a>(rs, 1);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> ((n = <a class="code" href="group___ocilib_c_api_longs.html#gad7e0ba53269cc2d5aace557a984c8717">OCI_LongRead</a>(lg, buffer, <span class="keyword">sizeof</span>(buffer)))) {}</div>
<div class="line"></div>
<div class="line">        printf(<span class="stringliteral">&quot;\n%d bytes read\n&quot;</span>, <a class="code" href="group___ocilib_c_api_longs.html#gaf7ed15bc901e38b9bc3394f334bf8d4c">OCI_LongGetSize</a>(lg));</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga040ec19ae09a29b34e0143e39ab30939"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#ga040ec19ae09a29b34e0143e39ab30939">OCI_LongCreate</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *stmt, unsigned int type)</td></tr>
<tr class="memdesc:ga040ec19ae09a29b34e0143e39ab30939"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a local temporary Long instance.  <a href="#ga040ec19ae09a29b34e0143e39ab30939">More...</a><br /></td></tr>
<tr class="separator:ga040ec19ae09a29b34e0143e39ab30939"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc23551bd5aa7832cbaee4e32a2b283a"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#gadc23551bd5aa7832cbaee4e32a2b283a">OCI_LongFree</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg)</td></tr>
<tr class="memdesc:gadc23551bd5aa7832cbaee4e32a2b283a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free a local temporary long.  <a href="#gadc23551bd5aa7832cbaee4e32a2b283a">More...</a><br /></td></tr>
<tr class="separator:gadc23551bd5aa7832cbaee4e32a2b283a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga69ae3c008a5f540c4d7c6eca502b6898"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#ga69ae3c008a5f540c4d7c6eca502b6898">OCI_LongGetType</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg)</td></tr>
<tr class="memdesc:ga69ae3c008a5f540c4d7c6eca502b6898"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the type of the given Long object.  <a href="#ga69ae3c008a5f540c4d7c6eca502b6898">More...</a><br /></td></tr>
<tr class="separator:ga69ae3c008a5f540c4d7c6eca502b6898"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad7e0ba53269cc2d5aace557a984c8717"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#gad7e0ba53269cc2d5aace557a984c8717">OCI_LongRead</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg, void *buffer, unsigned int len)</td></tr>
<tr class="memdesc:gad7e0ba53269cc2d5aace557a984c8717"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a portion of a long into the given buffer [Obsolete].  <a href="#gad7e0ba53269cc2d5aace557a984c8717">More...</a><br /></td></tr>
<tr class="separator:gad7e0ba53269cc2d5aace557a984c8717"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a76c2c5de1c81d38be17bf28524ce99"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#ga1a76c2c5de1c81d38be17bf28524ce99">OCI_LongWrite</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg, void *buffer, unsigned int len)</td></tr>
<tr class="memdesc:ga1a76c2c5de1c81d38be17bf28524ce99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a buffer into a Long.  <a href="#ga1a76c2c5de1c81d38be17bf28524ce99">More...</a><br /></td></tr>
<tr class="separator:ga1a76c2c5de1c81d38be17bf28524ce99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7ed15bc901e38b9bc3394f334bf8d4c"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT unsigned int OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#gaf7ed15bc901e38b9bc3394f334bf8d4c">OCI_LongGetSize</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg)</td></tr>
<tr class="memdesc:gaf7ed15bc901e38b9bc3394f334bf8d4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the buffer size of a long object in bytes (OCI_BLONG) or character (OCI_CLONG)  <a href="#gaf7ed15bc901e38b9bc3394f334bf8d4c">More...</a><br /></td></tr>
<tr class="separator:gaf7ed15bc901e38b9bc3394f334bf8d4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee33459c8a44c3216df4335627cac818"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT void *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_longs.html#gaee33459c8a44c3216df4335627cac818">OCI_LongGetBuffer</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg)</td></tr>
<tr class="memdesc:gaee33459c8a44c3216df4335627cac818"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the internal buffer of an OCI_Long object read from a fetch sequence.  <a href="#gaee33459c8a44c3216df4335627cac818">More...</a><br /></td></tr>
<tr class="separator:gaee33459c8a44c3216df4335627cac818"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga040ec19ae09a29b34e0143e39ab30939"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a>* OCI_API OCI_LongCreate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *&#160;</td>
          <td class="paramname"><em>stmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Create a local temporary Long instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stmt</td><td>- Statement handle </td></tr>
    <tr><td class="paramname">type</td><td>- Long type</td></tr>
  </table>
  </dd>
</dl>
<p>Supported lob types :</p>
<ul>
<li>OCI_BLONG : Binary Long</li>
<li>OCI_CLONG : Character Long</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>Return the long handle on success otherwise NULL on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_long.html#a626e9ce8628186b849ab759365ae8c2d">ocilib::Long&lt; TLongObjectType, TLongOracleType &gt;::Long()</a>.</p>

</div>
</div>
<a class="anchor" id="gadc23551bd5aa7832cbaee4e32a2b283a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_LongFree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Free a local temporary long. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Only lobs created with <a class="el" href="group___ocilib_c_api_longs.html#ga040ec19ae09a29b34e0143e39ab30939" title="Create a local temporary Long instance. ">OCI_LongCreate()</a> should be freed by <a class="el" href="group___ocilib_c_api_longs.html#gadc23551bd5aa7832cbaee4e32a2b283a" title="Free a local temporary long. ">OCI_LongFree()</a></dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_long.html#a626e9ce8628186b849ab759365ae8c2d">ocilib::Long&lt; TLongObjectType, TLongOracleType &gt;::Long()</a>.</p>

</div>
</div>
<a class="anchor" id="ga69ae3c008a5f540c4d7c6eca502b6898"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_LongGetType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the type of the given Long object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>For possible values, see <a class="el" href="group___ocilib_c_api_lobs.html#ga318f1273603e24b51c3d9e4c29f42685" title="Create a local temporary Lob instance. ">OCI_LobCreate()</a></dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Object type or OCI_UNKNOWN the input handle is NULL </dd></dl>

</div>
</div>
<a class="anchor" id="gad7e0ba53269cc2d5aace557a984c8717"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_LongRead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Read a portion of a long into the given buffer [Obsolete]. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle </td></tr>
    <tr><td class="paramname">buffer</td><td>- Pointer to a buffer </td></tr>
    <tr><td class="paramname">len</td><td>- Length of the buffer in bytes / characters</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>From version 2.0.0, this function is obsolete because OCILIB fetches now all data during OCIFetchNext() call</li>
<li>So, this call reads now the internal OCI_Long object allocated buffer</li>
<li>The internal buffer can be directly accessed with <a class="el" href="group___ocilib_c_api_longs.html#gaee33459c8a44c3216df4335627cac818" title="Return the internal buffer of an OCI_Long object read from a fetch sequence. ">OCI_LongGetBuffer()</a></li>
</ul>
</dd>
<dd>
<ul>
<li>For OCI_CLONG, parameter 'len' and returned value are expressed in characters</li>
<li>For OCI_BLONG, parameter 'len' and returned value are expressed in bytes</li>
</ul>
</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Number of bytes/characters read on success</li>
<li>0 if there is nothing more to read</li>
<li>0 on failure </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga1a76c2c5de1c81d38be17bf28524ce99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_LongWrite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Write a buffer into a Long. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle </td></tr>
    <tr><td class="paramname">buffer</td><td>- the pointer to a buffer </td></tr>
    <tr><td class="paramname">len</td><td>- the length of the buffer in bytes (OCI_BLONG) or character (OCI_CLONG)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of bytes (OCI_BLONG) / character (OCI_CLONG) written on success otherwise 0 on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_long.html#a356441911c5d27fb376e2580077d8379">ocilib::Long&lt; TLongObjectType, TLongOracleType &gt;::Write()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf7ed15bc901e38b9bc3394f334bf8d4c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT unsigned int OCI_API OCI_LongGetSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the buffer size of a long object in bytes (OCI_BLONG) or character (OCI_CLONG) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="classocilib_1_1_long.html#a0e53bfd674f41a290c3130aa4db27331">ocilib::Long&lt; TLongObjectType, TLongOracleType &gt;::GetLength()</a>.</p>

</div>
</div>
<a class="anchor" id="gaee33459c8a44c3216df4335627cac818"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT void* OCI_API OCI_LongGetBuffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *&#160;</td>
          <td class="paramname"><em>lg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Return the internal buffer of an OCI_Long object read from a fetch sequence. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lg</td><td>- Long handle </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:37 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
